-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic update of RCT-Folly
#32659
Conversation
Hi @fortmarek! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Base commit: e330eee |
Base commit: e330eee |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@cortinico has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @fortmarek that looks great,
I don't have enough context on why
RCT-Folly
is bundled the way it is, so I am open to suggestions here.
I'd love to get feedback from @fkgozali and @sota000 as they have more context than me on how RCT-Folly is bundled and they could spot potential problems with this PR. Overall looks good to me though 👍
Hi @fortmarek, sorry for the delayed response! My question would be that if RCT-Folly has the problem, wouldn't some other modules with the same setup have the same problem? As for local vs. third party set up, I don't really have the history context either. It might be possible that it was done it because how the podspec file for RCT-Folly was set up. Maybe a better solution could be try to make it a local podspec? |
Hey @sota000!
Correct, I have updated the PR to automatically update all podspecs in
Currently, it is a local podspec. The alternatives are:
I'm leaning to keeping the current solution, although migrating to remote pods might be a good solution as well. However, that's something I cannot help with since the remote pods would have to published by Facebook employees/React Native Core group. |
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@sota000 any updates on this one? |
Hey @fkgozali, is there any chance you can look at this PR? 🙏 |
Hi there! I was looking into this issue. That said, for the time being, I think we can live with this patch. Improving how the pods work would be an effort that we have to carry out soon, to reduce complexity and technical debt. |
This pull request was successfully merged by @fortmarek in b2517c3. When will my fix make it into a release? | Upcoming Releases |
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react` and `react-test-renderer` to follow the RN template app - Adapt to changes in Flow: - Two options removed: esproposal.optional_chaining, esproposal.nullish_coalescing - RN no longer clobbers Flow's built-in definitions for `fetch`! - Etc.; see comments - Add react-native-codegen, at ^0.0.7. The RN maintainers moved this dep back and forth between the `react-native` NPM package and the RN template app. For RN v0.65 it ended up in the template app, suggesting that projects using RN v0.65 should depend on it directly. So, do that. See discussion: zulip#5324 (comment)
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react` and `react-test-renderer` to follow the RN template app - Adapt to changes in Flow: - Two options removed: esproposal.optional_chaining esproposal.nullish_coalescing - RN no longer clobbers Flow's built-in definitions for `fetch`! - Etc.; see comments - Add react-native-codegen, at ^0.0.7. The RN maintainers moved this dep back and forth between the `react-native` NPM package and the RN template app. For RN v0.65 it ended up in the template app, suggesting that projects using RN v0.65 should depend on it directly. So, do that. See discussion: zulip#5324 (comment)
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react` and `react-test-renderer` to follow the RN template app - Adapt to changes in Flow: - Two options removed: esproposal.optional_chaining esproposal.nullish_coalescing - RN no longer clobbers Flow's built-in definitions for `fetch`! - Etc.; see comments - Add react-native-codegen, at ^0.0.7. The RN maintainers moved this dep back and forth between the `react-native` NPM package and the RN template app. For RN v0.65 it ended up in the template app, suggesting that projects using RN v0.65 should depend on it directly. So, do that. See discussion: zulip#5324 (comment)
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react-native` and `flow-bin` versions - Suppress a few errors from the new Flow version (see comments) - Remove react-native-codegen, following the template-app change in facebook/react-native@ab829005b - Add a hack line to the Podfile, following the template-app change in facebook/react-native@ea5109fc0
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react-native` and `flow-bin` versions - Suppress a few errors from the new Flow version (see comments) - Remove react-native-codegen, following the template-app change in facebook/react-native@ab829005b - Add a hack line to the Podfile, following the template-app change in facebook/react-native@ea5109fc0
Note: If you get an error like CocoaPods could not find compatible versions for pod "RCT-Folly" on `yarn` or `pod install` when crossing this commit (checking out a branch that has it from one that doesn't, or vice versa), run `pod update RCT-Folly` from `ios/` and try the command again. Background: facebook/react-native#32659 (comment) In this commit: - Bump `react-native` and `flow-bin` versions - Suppress a few errors from the new Flow version (see comments) - Remove react-native-codegen, following the template-app change in facebook/react-native@ab829005b - Add a hack line to the Podfile, following the template-app change in facebook/react-native@ea5109fc0
Summary: When upgrading `react-native`, the version `RCT-Folly` defined [here](https://github.com/facebook/react-native/blob/main/third-party-podspecs/RCT-Folly.podspec) can change. If that happens, if you run `pod install` after `yarn install`, you will get a similar error to this: ``` [!] CocoaPods could not find compatible versions for pod "RCT-Folly": In snapshot (Podfile.lock): RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) In Podfile: RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) was resolved to 0.66.3, which depends on RCT-Folly (= 2021.06.28.00-v2) ``` This error occurs because `Cocoapods` does not update pods that point to a local podspec. Locally, you could resolve this issue by running `pod update RCT-Folly --no-repo-update`. On the CI, you have to do a clean checkout (in case you cache the `Pods` folder which we do). All of this makes upgrading `react-native` painful - for the whole community and for us shopify There are other users who have struggled with this, such as [here](facebook#32423). The suggestion there is to delete `Podfile.lock` which is unnecessary - but it shows that users are confused what to do with this error and is something worth fixing. To mitigate these issues, `react_native_pods.rb` automatically marks `RCT-Folly` as changed in the [detect_changes_with_podfile method](https://github.com/CocoaPods/Core/blob/master/lib/cocoapods-core/lockfile.rb#L289) from `Pod::Lockfile` if the version in `node_modules/react-native/third-party-podspecs/RCT-Folly.podspec` and `Pods/Local Podspecs/RCT-Folly.podspec.json` mismatch. Instead of automatically updating the local podspec (in `Pods/Local Podspecs` directory) we could also: a) integrate `RCT-Folly` as a local pod (such as `React-Core` and others) b) integrate `RCT-Folly` as an external dependency (going through Cocoapods' centralized repository) I don't have enough context on why `RCT-Folly` is bundled the way it is, so I am open to suggestions here. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - Fix `pod install` when `RCT-Folly` version has been updated. Pull Request resolved: facebook#32659 Test Plan: I have created a [repository](https://github.com/fortmarek/react-native-upgrade-reproduction) where you can reproduce the issue. You can simply: 1) clone the repo (`git clone https://github.com/fortmarek/react-native-upgrade-reproduction`) 2) Run `yarn install && cd ios && pod install` 3) Change `react-native` version in `package.json` to `0.66.3` 4) Run again `yarn install && pod install` 5) Observe error To test the fix, you can then: 1) copy-paste the `react_native_pods.rb` file from this branch to `react-native-upgrade-reproduction/node_modules/scripts/react_native_pods.rb` 2) run `pod install` again This time, the `pod install` command should succeed. Reviewed By: sota000 Differential Revision: D32720758 Pulled By: cortinico fbshipit-source-id: 940db9c9f0530f896e47b676dec46bc93cea0085
Summary
When upgrading
react-native
, the versionRCT-Folly
defined here can change. If that happens, if you runpod install
afteryarn install
, you will get a similar error to this:This error occurs because
Cocoapods
does not update pods that point to a local podspec. Locally, you could resolve this issue by runningpod update RCT-Folly --no-repo-update
. On the CI, you have to do a clean checkout (in case you cache thePods
folder which we do). All of this makes upgradingreact-native
painful - for the whole community and for us @ShopifyThere are other users who have struggled with this, such as here. The suggestion there is to delete
Podfile.lock
which is unnecessary - but it shows that users are confused what to do with this error and is something worth fixing.To mitigate these issues,
react_native_pods.rb
automatically marksRCT-Folly
as changed in the detect_changes_with_podfile method fromPod::Lockfile
if the version innode_modules/react-native/third-party-podspecs/RCT-Folly.podspec
andPods/Local Podspecs/RCT-Folly.podspec.json
mismatch.Instead of automatically updating the local podspec (in
Pods/Local Podspecs
directory) we could also:a) integrate
RCT-Folly
as a local pod (such asReact-Core
and others)b) integrate
RCT-Folly
as an external dependency (going through Cocoapods' centralized repository)I don't have enough context on why
RCT-Folly
is bundled the way it is, so I am open to suggestions here.Changelog
[iOS] [Fixed] - Fix
pod install
whenRCT-Folly
version has been updated.Test Plan
I have created a repository where you can reproduce the issue. You can simply:
git clone https://github.com/fortmarek/react-native-upgrade-reproduction
)yarn install && cd ios && pod install
react-native
version inpackage.json
to0.66.3
yarn install && pod install
To test the fix, you can then:
react_native_pods.rb
file from this branch toreact-native-upgrade-reproduction/node_modules/scripts/react_native_pods.rb
pod install
againThis time, the
pod install
command should succeed.